//
//  EventDetailBaseCell.m
//  ConvenientlyTake
//
//  Created by 森鑫 on 2022/12/22.
//

#import "EventDetailBaseCell.h"
#import "EventDetailModel.h"

@implementation EventDetailBaseCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    // Configure the view for the selected state
}

-(void)fillDataWith:(EventDetailModel *)model andTitleString:(NSString *)titleString{
    self.model = model;
    self.desLabel.text = titleString;
    // 默认状态
    if ([titleString isEqualToString:@"事件单号"]) {
        self.contentLabel.text = R(model.eventCode);
    } else if ([titleString isEqualToString:@"当前处置部门"]) {
        self.contentLabel.text = R(model.disposalDepartmentName);
    } else if ([titleString isEqualToString:@"要求处置时间"]) {
        self.contentLabel.text = R(model.requiredDisposeCompletionTime);
    } else if ([titleString isEqualToString:@"处置完成时间"]) {
        self.contentLabel.text = R(model.disposeCompletionTime);
    } else if ([titleString isEqualToString:@"办结时间"]) {
        self.contentLabel.text = R(model.completionTime);
    }
    
    // 反映信息
    else if ([titleString isEqualToString:@"联系方式"]) {
        self.contentLabel.text = R(model.promoterPhone);
    } else if ([titleString isEqualToString:@"事件类型"]) {
        self.contentLabel.text = R(model.eventTypeName);
    }else if ([titleString isEqualToString:@"发起时间"]) {
        self.contentLabel.text = R(model.originatingTime);
    }else if ([titleString isEqualToString:@"发生地点"]) {
        self.contentLabel.text = R(model.address);
    }
 
    // 处置 - 处置人、处置意见、图片、提交时间
    // 不予受理 - 操作人、意见、图片、提交时间
    else if ([titleString isEqualToString:@"操作人"]) {
        self.contentLabel.text = R(model.noDisposalUserName);
    }
    else if ([titleString isEqualToString:@"处置人"]) {
        self.contentLabel.text = R(model.disposalUserName);
    }
    else if ([titleString isEqualToString:@"提交时间"]) {
        if(model.eventState == 8) { // 不予受理
            self.contentLabel.text = R(model.noDisposalOperationTime);
        } else {
            self.contentLabel.text = R(model.disposalTime);
        }
    }
    if ([self.contentLabel.text isEqualToString:@""]) {
        self.contentLabel.text = @"-";
    }
}

@end
